package me.itsoo.artemis.framework.core.enumer;

import me.itsoo.artemis.framework.core.collect.Kv;

import java.util.List;

/**
 * Resolve
 *
 * @author zxy
 * @version 0.0.1
 * @since 2023/5/1
 */
@SuppressWarnings({"rawtypes", "unchecked"})
public enum Resolve implements VirtualEnum<Resolve> {

    /**
     * 只表示两种状态：是/否
     */
    @Ev(code = 1, label = "是") Y,

    @Ev(code = 0, label = "否") N;

    /**
     * 获取展示名称
     *
     * @return String
     */
    public String getLabel() {
        return (String) Helper.create(Resolve.class).get(this);
    }

    /**
     * 获取枚举
     *
     * @param value Integer
     * @return Resolve
     */
    public static Resolve getEnum(Integer value) {
        return (Resolve) Helper.create(Resolve.class).get(value);
    }

    /**
     * 获取全部枚举
     *
     * @return List
     */
    public static List<Kv<Integer, String>> getAll() {
        return (List) Helper.create(Resolve.class).get(ENUM_ALL);
    }
}
